package com.zzyl.mapper;

import com.zzyl.entity.Bed;
import com.zzyl.vo.BedVo;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface BedMapper {

    List<BedVo> getBedsByRoomId(Long roomId);

    void addBed(Bed bed);

    @Select("SELECT * FROM bed WHERE id = #{id}")
    Bed getBedById(@Param("id") Long id);

    int updateBed(@Param("bed") Bed bed);

    @Delete("delete from bed where id = #{id}")
    void deleteById(Long id);
}

